Skip to content

USHIFT-6789: Fix etcd issue#6484

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
kasturinarra:main
Apr 16, 2026
Merged

USHIFT-6789: Fix etcd issue#6484
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
kasturinarra:main

Conversation

@kasturinarra
Copy link
Copy Markdown
Contributor

No description provided.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 2bd3c241-9abd-405d-80b4-f939dbabdedc

📥 Commits

Reviewing files that changed from the base of the PR and between 77b1bdb and 706dfd7.

📒 Files selected for processing (1)
  • test/suites/standard1/etcd.robot

Walkthrough

Adds a new Robot Framework keyword Create Etcd Fragmentation and calls it from Etcd Database Defragment Manually; the keyword performs 100 etcd put/delete operations with ~1KiB random values, then compacts at the current endpoint revision before running defrag.

Changes

Cohort / File(s) Summary
Etcd Test Enhancements
test/suites/standard1/etcd.robot
Added Create Etcd Fragmentation keyword that issues 100 etcdctl put of ~1KiB random values under /defrag-test/key-${i}, runs 100 etcdctl del to create fragmentation, extracts the endpoint revision from status JSON, runs etcdctl compact at that revision, and invoked this keyword from Etcd Database Defragment Manually before measuring/defragmenting.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci bot requested review from pacevedom and vanhalenar April 9, 2026 09:44
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 9, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@test/suites/standard1/etcd.robot`:
- Line 151: The test call to the Robot keyword "Command Should Work" with
${ETCDCTL_CMD} put /defrag-test/key-${i} uses an unquoted $(head -c 1024
/dev/urandom | base64) which can be split by newlines; update the test so the
generated payload is passed as a single argument to etcdctl (either wrap the
$(...) substitution in quotes or change the base64 invocation to emit no line
breaks, e.g., use base64 with the no-wrap option), ensuring the value after "put
/defrag-test/key-${i}" is not subject to shell word-splitting.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 72ca2f3d-d5b5-407e-96cf-e704f3f436b8

📥 Commits

Reviewing files that changed from the base of the PR and between d9ab91d and be8db1f.

📒 Files selected for processing (1)
  • test/suites/standard1/etcd.robot

Comment thread test/suites/standard1/etcd.robot Outdated
@kasturinarra kasturinarra changed the title Fix etcd issue USHIFT-6789: Fix etcd issue Apr 9, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 9, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 9, 2026

@kasturinarra: This pull request references USHIFT-6789 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
test/suites/standard1/etcd.robot (1)

156-156: Refactor Line 156 for maintainability/debuggability.

The nested shell+Python substitution is hard to troubleshoot. Split status fetch, revision parse, and compact into separate steps.

Proposed refactor
-    Command Should Work    ${ETCDCTL_CMD} compact $(${ETCDCTL_CMD} endpoint status --write-out\=json | python3 -c "import sys,json; print(json.load(sys.stdin)[0]['Status']['header']['revision'])")
+    ${status}=    Command Should Work    ${ETCDCTL_CMD} endpoint status --write-out\=json
+    ${revision}=    Command Should Work
+    ...    printf '%s' '${status}' | python3 -c "import sys,json; print(json.load(sys.stdin)[0]['Status']['header']['revision'])"
+    Command Should Work    ${ETCDCTL_CMD} compact ${revision}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/suites/standard1/etcd.robot` at line 156, Refactor the nested
shell+Python substitution in the Robot test by splitting it into three clear
steps: (1) call `${ETCDCTL_CMD} endpoint status --write-out=json` with `Command
Should Work` and capture its stdout into a variable, (2) parse that JSON stdout
to extract `Status.header.revision` (e.g., using a small Robot Python keyword or
the `Evaluate` keyword instead of an inline `python3 -c`), and store the
revision in e.g. `${REVISION}`, and (3) run `Command Should Work   
${ETCDCTL_CMD} compact ${REVISION}`; replace the single-line `Command Should
Work ${ETCDCTL_CMD} compact $(...)` with these three steps so `ETCDCTL_CMD`, the
status call, the parsing logic, and the `compact` call are all explicit and
easier to debug.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@test/suites/standard1/etcd.robot`:
- Line 156: Refactor the nested shell+Python substitution in the Robot test by
splitting it into three clear steps: (1) call `${ETCDCTL_CMD} endpoint status
--write-out=json` with `Command Should Work` and capture its stdout into a
variable, (2) parse that JSON stdout to extract `Status.header.revision` (e.g.,
using a small Robot Python keyword or the `Evaluate` keyword instead of an
inline `python3 -c`), and store the revision in e.g. `${REVISION}`, and (3) run
`Command Should Work    ${ETCDCTL_CMD} compact ${REVISION}`; replace the
single-line `Command Should Work ${ETCDCTL_CMD} compact $(...)` with these three
steps so `ETCDCTL_CMD`, the status call, the parsing logic, and the `compact`
call are all explicit and easier to debug.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 7c60af01-f721-46fb-b0d5-440777f615a6

📥 Commits

Reviewing files that changed from the base of the PR and between be8db1f and 3eb4e56.

📒 Files selected for processing (1)
  • test/suites/standard1/etcd.robot

@kasturinarra
Copy link
Copy Markdown
Contributor Author

/test e2e-aws-tests-release-arm-periodic

@kasturinarra
Copy link
Copy Markdown
Contributor Author

/pj-rehearse periodic-ci-openshift-microshift-release-4.22-periodics-e2e-aws-tests-release-arm-periodic

@kasturinarra
Copy link
Copy Markdown
Contributor Author

/test e2e-aws-tests-periodic-arm

@kasturinarra
Copy link
Copy Markdown
Contributor Author

/test e2e-aws-tests-release-arm

@agullon
Copy link
Copy Markdown
Contributor

agullon commented Apr 14, 2026

@kasturinarra thank you very much for this fix. I added Etcd Database Defragment Manually test case few weeks ago and I was about to remove it completely because it does not test any microshift code (only etcd) and it's failing most of the times because it's very sensitive.

If your proposal in current PR works and it's stable I'm happy to merged it. If not or difficult to maintain I think it's safe to remove it.

@pmtk
Copy link
Copy Markdown
Member

pmtk commented Apr 14, 2026

/retest

@kasturinarra
Copy link
Copy Markdown
Contributor Author

@kasturinarra thank you very much for this fix. I added Etcd Database Defragment Manually test case few weeks ago and I was about to remove it completely because it does not test any microshift code (only etcd) and it's failing most of the times because it's very sensitive.

If your proposal in current PR works and it's stable I'm happy to merged it. If not or difficult to maintain I think it's safe to remove it.

@agullon ah, any specific reason you added it ? We had a discussion about this and thought this was a case that was added long back, if this does not test anything let us remove it instead of wasting cycles to fix it ? WDYS ?

@agullon
Copy link
Copy Markdown
Contributor

agullon commented Apr 14, 2026

@kasturinarra thank you very much for this fix. I added Etcd Database Defragment Manually test case few weeks ago and I was about to remove it completely because it does not test any microshift code (only etcd) and it's failing most of the times because it's very sensitive.
If your proposal in current PR works and it's stable I'm happy to merged it. If not or difficult to maintain I think it's safe to remove it.

@agullon ah, any specific reason you added it ? We had a discussion about this and thought this was a case that was added long back, if this does not test anything let us remove it instead of wasting cycles to fix it ? WDYS ?

Main reason I added it: it took less than a second to run, and I thought it may be nice to have it.

With the change you added it this PR it looks is not gonna failed anymore because, I checked it reviewing this log. But it takes now 20 seconds to run, which is ok.

I'll lgtm and override failed CI jobs. You can decide to apply verified label or close the PR. I'm ok either way.

/lgtm
/override ci/prow/e2e-aws-tests-release-arm
/override ci/prow/e2e-aws-tests-bootc-el9
/override ci/prow/e2e-aws-tests-bootc-el10
/override ci/prow/e2e-aws-tests-bootc-arm-el9

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 14, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 14, 2026

@agullon: Overrode contexts on behalf of agullon: ci/prow/e2e-aws-tests-bootc-arm-el9, ci/prow/e2e-aws-tests-bootc-el10, ci/prow/e2e-aws-tests-bootc-el9, ci/prow/e2e-aws-tests-release-arm

Details

In response to this:

@kasturinarra thank you very much for this fix. I added Etcd Database Defragment Manually test case few weeks ago and I was about to remove it completely because it does not test any microshift code (only etcd) and it's failing most of the times because it's very sensitive.
If your proposal in current PR works and it's stable I'm happy to merged it. If not or difficult to maintain I think it's safe to remove it.

@agullon ah, any specific reason you added it ? We had a discussion about this and thought this was a case that was added long back, if this does not test anything let us remove it instead of wasting cycles to fix it ? WDYS ?

Main reason I added it: it took less than a second to run, and I thought it may be nice to have it.

With the change you added it this PR it looks is not gonna failed anymore because, I checked it reviewing this log. But it takes now 20 seconds to run, which is ok.

I'll lgtm and override failed CI jobs. You can decide to apply verified label or close the PR. I'm ok either way.

/lgtm
/override ci/prow/e2e-aws-tests-release-arm
/override ci/prow/e2e-aws-tests-bootc-el9
/override ci/prow/e2e-aws-tests-bootc-el10
/override ci/prow/e2e-aws-tests-bootc-arm-el9

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@agullon
Copy link
Copy Markdown
Contributor

agullon commented Apr 14, 2026

@kasturinarra thank you very much for this fix. I added Etcd Database Defragment Manually test case few weeks ago and I was about to remove it completely because it does not test any microshift code (only etcd) and it's failing most of the times because it's very sensitive.
If your proposal in current PR works and it's stable I'm happy to merged it. If not or difficult to maintain I think it's safe to remove it.

@agullon ah, any specific reason you added it ? We had a discussion about this and thought this was a case that was added long back, if this does not test anything let us remove it instead of wasting cycles to fix it ? WDYS ?

Main reason I added it: it took less than a second to run, and I thought it may be nice to have it.

With the change you added it this PR it looks is not gonna failed anymore because, I checked it reviewing this log. But it takes now 20 seconds to run, which is ok.

I'll lgtm and override failed CI jobs. You can decide to apply verified label or close the PR. I'm ok either way.

/lgtm /override ci/prow/e2e-aws-tests-release-arm /override ci/prow/e2e-aws-tests-bootc-el9 /override ci/prow/e2e-aws-tests-bootc-el10 /override ci/prow/e2e-aws-tests-bootc-arm-el9

@kasturinarra you can reduce the time it takes to run reducing the for loops to run 20 times intead of 100, for example.

@kasturinarra
Copy link
Copy Markdown
Contributor Author

@kasturinarra thank you very much for this fix. I added Etcd Database Defragment Manually test case few weeks ago and I was about to remove it completely because it does not test any microshift code (only etcd) and it's failing most of the times because it's very sensitive.
If your proposal in current PR works and it's stable I'm happy to merged it. If not or difficult to maintain I think it's safe to remove it.

@agullon ah, any specific reason you added it ? We had a discussion about this and thought this was a case that was added long back, if this does not test anything let us remove it instead of wasting cycles to fix it ? WDYS ?

Main reason I added it: it took less than a second to run, and I thought it may be nice to have it.
With the change you added it this PR it looks is not gonna failed anymore because, I checked it reviewing this log. But it takes now 20 seconds to run, which is ok.
I'll lgtm and override failed CI jobs. You can decide to apply verified label or close the PR. I'm ok either way.
/lgtm /override ci/prow/e2e-aws-tests-release-arm /override ci/prow/e2e-aws-tests-bootc-el9 /override ci/prow/e2e-aws-tests-bootc-el10 /override ci/prow/e2e-aws-tests-bootc-arm-el9

@kasturinarra you can reduce the time it takes to run reducing the for loops to run 20 times intead of 100, for example.

@pmtk WDYT ? shall we go ahead and merge it ?

@pmtk
Copy link
Copy Markdown
Member

pmtk commented Apr 16, 2026

@kasturinarra thank you very much for this fix. I added Etcd Database Defragment Manually test case few weeks ago and I was about to remove it completely because it does not test any microshift code (only etcd) and it's failing most of the times because it's very sensitive.
If your proposal in current PR works and it's stable I'm happy to merged it. If not or difficult to maintain I think it's safe to remove it.

@agullon ah, any specific reason you added it ? We had a discussion about this and thought this was a case that was added long back, if this does not test anything let us remove it instead of wasting cycles to fix it ? WDYS ?

Main reason I added it: it took less than a second to run, and I thought it may be nice to have it.
With the change you added it this PR it looks is not gonna failed anymore because, I checked it reviewing this log. But it takes now 20 seconds to run, which is ok.
I'll lgtm and override failed CI jobs. You can decide to apply verified label or close the PR. I'm ok either way.
/lgtm /override ci/prow/e2e-aws-tests-release-arm /override ci/prow/e2e-aws-tests-bootc-el9 /override ci/prow/e2e-aws-tests-bootc-el10 /override ci/prow/e2e-aws-tests-bootc-arm-el9

@kasturinarra you can reduce the time it takes to run reducing the for loops to run 20 times intead of 100, for example.

@pmtk WDYT ? shall we go ahead and merge it ?

I'm not sure if 20 iterations would provide enough fragmentation.
Upstream is using 10k, but for us this is just a sanity test.
Let's merge it.

/lgtm

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 16, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: agullon, kasturinarra, pmtk

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [agullon,kasturinarra,pmtk]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kasturinarra
Copy link
Copy Markdown
Contributor Author

/verified by CI

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Apr 16, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@kasturinarra: This PR has been marked as verified by CI.

Details

In response to this:

/verified by CI

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 16, 2026

@kasturinarra: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit 87d90b3 into openshift:main Apr 16, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants